<script>   
    $(function(){
         $(document).ready(function() {
            $("#rquest_extend").click(function() {
                var result = confirm("Do you really wish to extend your car listing for another one month?");
                return result;
            });
    
            $("#rquest_delete").click(function() {
                var result = confirm("Do you really wish to stop listing your car on www.psacar.com?");
                return result;
            });
			
			$(".gallery").colorbox({
				rel:'gallery'
			});
        });
    });            
</script>
<?php
    $module = $this->uri->segment(1);
?>        
<?php 
    foreach($car_list->result() as $row)
    { 
        if ($this->session->userdata('validated') &&
            ($this->session->userdata('userid') == $row->dealer_id)) {
?>
    <div class="get_quote">
        <a id="rquest_extend" href="<?php echo base_url(); ?>index.php/car/extend/<?php echo $row->id; ?>">
            <img src="<?php echo base_url(); ?>system/public/img/calendar.png" alt="Extend" title="Request to extend car listing" />
        </a>
        <a id="rquest_delete" href="<?php echo base_url(); ?>index.php/car/delete/<?php echo $row->id; ?>">
            <img src="<?php echo base_url(); ?>system/public/img/delete.png" alt="Delete" title="Request to delete car" />
        </a>
    </div>
<?php
        }
?>
    <h1 class="blue">
<?php
        echo $row->car_serie . " " . $row->car_make . " " . $row->car_model;
    ?>
        <span class="car-detail">
<?php
        if(strtoupper($module) != 'RENT')
        {    
            echo " - $" . number_format($row->car_price, 0);
        }
?>
        </span>        
    </h1>
    <div class="modelGroup">  
        <div class= "modelItem">
            <div style="float: left;">
<?php
				$this->load->model('Car_model');				
				$this->Car_model->car_image($row->id);
?>
                <div class='vote'>
<?php
                    $this->load->view('templates/car/car_vote'); 
    ?>
                </div>
            </div>
            <div style="float: right;">
                <table cellspacing="0" cellpadding="0">
                    <tbody>
                        <tr>
                            <td valign="top">
                                <div class="data-point">      
                                    <span class="label">Type:</span>
                                    <span class="data">
<?php
                                        echo $row->car_type;
?>
                                    </span>      
                                </div>
                                <div class="data-point">               
                                    <span class="label">Category:</span>         
                                    <span class="data">
<?php
                                        echo $row->car_category;
?>
                                    </span>      
                                </div>
                                <div class="data-point">               
                                    <span class="label">Exterior Color:</span>         
                                    <span class="data">
<?php
                                        echo $row->external_color;
?>
                                    </span>      
                                </div>
                                <div class="data-point">      
                                    <span class="label">Interior Color:</span>
                                    <span class="data">
<?php
                                        echo $row->internal_color;
?>                                        
                                    </span>      
                                </div>
                            </td>
                            <td valign="top">
                                <div class="data-point">               
                                    <span class="label">Fuel:</span>         
                                    <span class="data">
<?php
									$this->Car_model->car_fuel($row->fuel);
?>                                        
                                    </span>      
                                </div>   
                                <div class="data-point">               
                                    <span class="label">Transmission:</span>         
                                    <span class="data">
<?php                                        
                                        echo $row->transmission;
?>                                        
                                    </span>      
                                </div>   
                                <div class="data-point">               
                                    <span class="label">Drive Train:</span>         
                                    <span class="data">
<?php
                                        echo $row->drivetrain;
?>                                        
                                    </span>      
                                </div>   
                                <div class="data-point">      
                                    <span class="label">Doors:</span>
                                    <span class="data">
<?php
                                        echo $row->door_count;                                        
?>
                                    </span>      
                                </div>
                                <div class="data-point">               
                                    <span class="label">Dealer:</span>         
                                    <span class="data">
<?php
                                        echo $row->dealer_name;
?>
                                    </span>      
                                </div>   
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2">
<?php
                                echo $row->description;
    ?>
                            </td>
                        </tr>
                    </tbody>
                </table>                
            </div>
            <div style="clear: both;"></div>
        </div>
    </div>
<?php
    }
?>